package mysql

import "gorm.io/gorm"

type Shop struct {
	gorm.Model
	Title  string  `gorm:"type:varchar(50);not null;"`
	Cover  string  `gorm:"type:varchar(255);not null;"`
	Status string  `gorm:"type:varchar(30);not null;"`
	Stock  int     `gorm:"type:int;not null;"`
	Price  float64 `gorm:"type:decimal(10,2);not null;"`
}

func (s *Shop) Create() error {
	return DB.Create(&s).Error
}
func (s *Shop) ShopInfo(ShopId int) error {
	return DB.Where("Id=?", ShopId).First(&s).Error
}
